<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="dsZapKons" targetNamespace="http://tempuri.org/dsZapKons.xsd" xmlns:mstns="http://tempuri.org/dsZapKons.xsd" xmlns="http://tempuri.org/dsZapKons.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="p301ConnString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="p301ConnString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.p301.Properties.Settings.GlobalReference.Default.p301ConnString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="taZapKonsList" GeneratorDataComponentClassName="taZapKonsList" Name="dtZapKonsList" UserDataComponentName="taZapKonsList">
            <MainSource>
              <DbSource ConnectionRef="p301ConnString (Settings)" DbObjectName="p301.dbo.vRepZapKonsList" DbObjectType="View" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Fill" GenerateShortCommands="False" GeneratorSourceName="Fill" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     K_ZAP_KONS, N_PERIOD, D_ZAP, N_CAPTION
FROM         vRepZapKonsList
WHERE     (K_ZAP_KONS = @pK_ZAP_KONS)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="pK_ZAP_KONS" ColumnName="K_ZAP_KONS" DataSourceName="p301.dbo.vRepZapKonsList" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@pK_ZAP_KONS" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="K_ZAP_KONS" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="K_ZAP_KONS" DataSetColumn="K_ZAP_KONS" />
              <Mapping SourceColumn="N_PERIOD" DataSetColumn="N_PERIOD" />
              <Mapping SourceColumn="D_ZAP" DataSetColumn="D_ZAP" />
              <Mapping SourceColumn="N_CAPTION" DataSetColumn="N_CAPTION" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="taKpoNeprish" GeneratorDataComponentClassName="taKpoNeprish" Name="dtKpoNeprish" UserDataComponentName="taKpoNeprish">
            <MainSource>
              <DbSource ConnectionRef="p301ConnString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Fill" GenerateShortCommands="False" GeneratorSourceName="Fill" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     dbo.CompressFio(s_rab.N_RAB) AS N_RAB, dbo.N_FIO(b_kpo.N_FA, b_kpo.N_IM, b_kpo.N_OT) AS N_FIO, b_kpo.NPP_KPO, b_kpo.D_OBRASCH, 
                      b_kpo.V_OBRASCH, b_kpo.K_KPO, K_ZAP_KONS
FROM		bo_zap_kons_ 
			INNER JOIN b_zhurnal_obrasch on b_zhurnal_obrasch.K_ZHURNAL_OBRASCH = bo_zap_kons_.K_ZHURNAL_OBRASCH_ZAP
			INNER JOIN s_rab ON s_rab.K_RAB = bo_zap_kons_.K_RAB 
			INNER JOIN b_kpo ON b_kpo.K_KPO = b_zhurnal_obrasch.K_KPO
WHERE   isnull(K_ZHURNAL_OBRASCH_IAVKA,0) = 0 and  bo_zap_kons_.K_ZAP_KONS = @K_ZAP_KONS</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="True" AutogeneratedName="K_ZAP_KONS" ColumnName="K_ZAP_KONS" DataSourceName="p301.dbo.bo_zap_kons_" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@K_ZAP_KONS" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="K_ZAP_KONS" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="N_RAB" DataSetColumn="N_RAB" />
              <Mapping SourceColumn="N_FIO" DataSetColumn="N_FIO" />
              <Mapping SourceColumn="NPP_KPO" DataSetColumn="NPP_KPO" />
              <Mapping SourceColumn="D_OBRASCH" DataSetColumn="D_OBRASCH" />
              <Mapping SourceColumn="V_OBRASCH" DataSetColumn="V_OBRASCH" />
              <Mapping SourceColumn="K_KPO" DataSetColumn="K_KPO" />
              <Mapping SourceColumn="K_ZAP_KONS" DataSetColumn="K_ZAP_KONS" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="taZapKons" GeneratorDataComponentClassName="taZapKons" Name="dtZapKons" UserDataComponentName="taZapKons">
            <MainSource>
              <DbSource ConnectionRef="p301ConnString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Fill" GenerateShortCommands="False" GeneratorSourceName="Fill" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>select  N_RAB, sum(case when isnull(K_ZHURNAL_OBRASCH_ZAP,0) != 0 then 1 else 0 end) as C_ZAP,
		sum(case when isnull(K_ZHURNAL_OBRASCH_IAVKA,0) = 0 then 1 else 0 end) as C_NEIAVKA, 
		 K_ZAP_KONS
from bo_zap_kons_
	INNER JOIN s_rab ON s_rab.K_RAB = bo_zap_kons_.K_RAB
WHERE bo_zap_kons_.K_ZAP_KONS = @K_ZAP_KONS
GROUP BY N_RAB, bo_zap_kons_.K_RAB, K_ZAP_KONS

</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="True" AutogeneratedName="K_ZAP_KONS" ColumnName="K_ZAP_KONS" DataSourceName="p301.dbo.bo_zap_kons_" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@K_ZAP_KONS" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="K_ZAP_KONS" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="N_RAB" DataSetColumn="N_RAB" />
              <Mapping SourceColumn="C_ZAP" DataSetColumn="C_ZAP" />
              <Mapping SourceColumn="K_ZAP_KONS" DataSetColumn="K_ZAP_KONS" />
              <Mapping SourceColumn="C_NEIAVKA" DataSetColumn="C_NEIAVKA" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="dsZapKons" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dsZapKons" msprop:Generator_DataSetName="dsZapKons">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="dtZapKonsList" msprop:Generator_UserTableName="dtZapKonsList" msprop:Generator_RowDeletedName="dtZapKonsListRowDeleted" msprop:Generator_RowChangedName="dtZapKonsListRowChanged" msprop:Generator_RowClassName="dtZapKonsListRow" msprop:Generator_RowChangingName="dtZapKonsListRowChanging" msprop:Generator_RowEvArgName="dtZapKonsListRowChangeEvent" msprop:Generator_RowEvHandlerName="dtZapKonsListRowChangeEventHandler" msprop:Generator_TableClassName="dtZapKonsListDataTable" msprop:Generator_TableVarName="tabledtZapKonsList" msprop:Generator_RowDeletingName="dtZapKonsListRowDeleting" msprop:Generator_TablePropName="dtZapKonsList">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="K_ZAP_KONS" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="K_ZAP_KONS" msprop:Generator_ColumnVarNameInTable="columnK_ZAP_KONS" msprop:Generator_ColumnPropNameInRow="K_ZAP_KONS" msprop:Generator_ColumnPropNameInTable="K_ZAP_KONSColumn" type="xs:int" />
              <xs:element name="N_PERIOD" msdata:ReadOnly="true" msprop:Generator_UserColumnName="N_PERIOD" msprop:Generator_ColumnVarNameInTable="columnN_PERIOD" msprop:Generator_ColumnPropNameInRow="N_PERIOD" msprop:Generator_ColumnPropNameInTable="N_PERIODColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="D_ZAP" msprop:Generator_UserColumnName="D_ZAP" msprop:Generator_ColumnVarNameInTable="columnD_ZAP" msprop:Generator_ColumnPropNameInRow="D_ZAP" msprop:Generator_ColumnPropNameInTable="D_ZAPColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="N_CAPTION" msdata:ReadOnly="true" msprop:Generator_UserColumnName="N_CAPTION" msprop:Generator_ColumnVarNameInTable="columnN_CAPTION" msprop:Generator_ColumnPropNameInRow="N_CAPTION" msprop:Generator_ColumnPropNameInTable="N_CAPTIONColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="26" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dtKpoNeprish" msprop:Generator_UserTableName="dtKpoNeprish" msprop:Generator_RowDeletedName="dtKpoNeprishRowDeleted" msprop:Generator_RowChangedName="dtKpoNeprishRowChanged" msprop:Generator_RowClassName="dtKpoNeprishRow" msprop:Generator_RowChangingName="dtKpoNeprishRowChanging" msprop:Generator_RowEvArgName="dtKpoNeprishRowChangeEvent" msprop:Generator_RowEvHandlerName="dtKpoNeprishRowChangeEventHandler" msprop:Generator_TableClassName="dtKpoNeprishDataTable" msprop:Generator_TableVarName="tabledtKpoNeprish" msprop:Generator_RowDeletingName="dtKpoNeprishRowDeleting" msprop:Generator_TablePropName="dtKpoNeprish">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="N_RAB" msdata:ReadOnly="true" msprop:Generator_UserColumnName="N_RAB" msprop:Generator_ColumnVarNameInTable="columnN_RAB" msprop:Generator_ColumnPropNameInRow="N_RAB" msprop:Generator_ColumnPropNameInTable="N_RABColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="1024" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="N_FIO" msdata:ReadOnly="true" msprop:Generator_UserColumnName="N_FIO" msprop:Generator_ColumnVarNameInTable="columnN_FIO" msprop:Generator_ColumnPropNameInRow="N_FIO" msprop:Generator_ColumnPropNameInTable="N_FIOColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="155" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="NPP_KPO" msprop:Generator_UserColumnName="NPP_KPO" msprop:Generator_ColumnVarNameInTable="columnNPP_KPO" msprop:Generator_ColumnPropNameInRow="NPP_KPO" msprop:Generator_ColumnPropNameInTable="NPP_KPOColumn" type="xs:int" minOccurs="0" />
              <xs:element name="D_OBRASCH" msprop:Generator_UserColumnName="D_OBRASCH" msprop:Generator_ColumnVarNameInTable="columnD_OBRASCH" msprop:Generator_ColumnPropNameInRow="D_OBRASCH" msprop:Generator_ColumnPropNameInTable="D_OBRASCHColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="V_OBRASCH" msprop:Generator_UserColumnName="V_OBRASCH" msprop:Generator_ColumnVarNameInTable="columnV_OBRASCH" msprop:Generator_ColumnPropNameInRow="V_OBRASCH" msprop:Generator_ColumnPropNameInTable="V_OBRASCHColumn" type="xs:dateTime" minOccurs="0" />
              <xs:element name="K_KPO" msdata:ReadOnly="true" msprop:Generator_UserColumnName="K_KPO" msprop:Generator_ColumnVarNameInTable="columnK_KPO" msprop:Generator_ColumnPropNameInRow="K_KPO" msprop:Generator_ColumnPropNameInTable="K_KPOColumn" type="xs:int" minOccurs="0" />
              <xs:element name="K_ZAP_KONS" msprop:Generator_UserColumnName="K_ZAP_KONS" msprop:Generator_ColumnVarNameInTable="columnK_ZAP_KONS" msprop:Generator_ColumnPropNameInRow="K_ZAP_KONS" msprop:Generator_ColumnPropNameInTable="K_ZAP_KONSColumn" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="dtZapKons" msprop:Generator_UserTableName="dtZapKons" msprop:Generator_RowDeletedName="dtZapKonsRowDeleted" msprop:Generator_RowChangedName="dtZapKonsRowChanged" msprop:Generator_RowClassName="dtZapKonsRow" msprop:Generator_RowChangingName="dtZapKonsRowChanging" msprop:Generator_RowEvArgName="dtZapKonsRowChangeEvent" msprop:Generator_RowEvHandlerName="dtZapKonsRowChangeEventHandler" msprop:Generator_TableClassName="dtZapKonsDataTable" msprop:Generator_TableVarName="tabledtZapKons" msprop:Generator_RowDeletingName="dtZapKonsRowDeleting" msprop:Generator_TablePropName="dtZapKons">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="N_RAB" msprop:Generator_UserColumnName="N_RAB" msprop:Generator_ColumnPropNameInRow="N_RAB" msprop:Generator_ColumnVarNameInTable="columnN_RAB" msprop:Generator_ColumnPropNameInTable="N_RABColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="C_ZAP" msdata:ReadOnly="true" msprop:Generator_UserColumnName="C_ZAP" msprop:Generator_ColumnPropNameInRow="C_ZAP" msprop:Generator_ColumnVarNameInTable="columnC_ZAP" msprop:Generator_ColumnPropNameInTable="C_ZAPColumn" type="xs:int" minOccurs="0" />
              <xs:element name="K_ZAP_KONS" msprop:Generator_UserColumnName="K_ZAP_KONS" msprop:Generator_ColumnVarNameInTable="columnK_ZAP_KONS" msprop:Generator_ColumnPropNameInRow="K_ZAP_KONS" msprop:Generator_ColumnPropNameInTable="K_ZAP_KONSColumn" type="xs:int" minOccurs="0" />
              <xs:element name="C_NEIAVKA" msdata:ReadOnly="true" msprop:Generator_UserColumnName="C_NEIAVKA" msprop:Generator_ColumnPropNameInRow="C_NEIAVKA" msprop:Generator_ColumnVarNameInTable="columnC_NEIAVKA" msprop:Generator_ColumnPropNameInTable="C_NEIAVKAColumn" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:dtZapKonsList" />
      <xs:field xpath="mstns:K_ZAP_KONS" />
    </xs:unique>
  </xs:element>
</xs:schema>